package com.webRepo.spiderUtil;

import java.util.concurrent.ArrayBlockingQueue;

public class ContentPageProcessor implements ValueProcessor<String>{

    public String matchTactics(String value, String match) {
        String target = "var GvodUrls = \"";
        String[] split = value.split(target);
        if(split.length<2){
            return null;
        }
        String[] split2 = split[1].split("\";</script>");
        if(split2.length<2){
            return null;
        }
        String ed2k = split2[0];
        
        String moveName = value.split("<title>")[1].split("</title>")[0];
        return moveName+":"+ed2k;
    }

    public void processor(String t, ArrayBlockingQueue<String> queue) {
        System.out.println(Thread.currentThread().getName()+"==>"+t);
        queue.add(t);
    }

    
}
